package com.hibase.core.oss.service;


import com.hibase.core.mybatis.service.BaseService;
import com.hibase.core.oss.entity.Attachment;
import com.hibase.core.oss.entity.vo.AttachmentHelpVO;
import com.hibase.core.oss.entity.vo.FileUploadVO;
import org.springframework.web.multipart.MultipartFile;

import javax.servlet.http.HttpServletResponse;
import java.io.InputStream;
import java.io.UnsupportedEncodingException;
import java.util.List;

/**
 * <p>
 * 附件表 服务类
 * </p>
 *
 * @author hufeng
 * @since 2019-05-20
 */
public interface AttachmentService extends BaseService<Attachment> {

    /**
     * 上传附件
     * @param multipartFile
     * @return
     */
    String uploadFile(MultipartFile multipartFile);

	/**
	 * 上传附件
	 * @param multipartFile
	 * @param emsFileUploadVO
	 * @return
	 */
	String uploadFile(MultipartFile multipartFile,FileUploadVO emsFileUploadVO);

	/**
	 * 上传附件
	 * @param inputStream
	 * @param emsFileUploadVO
	 * @return
	 */
	String uploadFile(InputStream inputStream,FileUploadVO emsFileUploadVO);

    /**
     * 根据业务类型查询附件
     *
     * @param query
     * @return
     */
    List<Attachment> selectByBiz(Attachment query);

    /**
     * 保存附件信息
     *
     * @param attachmentHelpVO
     */
    List<Attachment> saveAttachment(AttachmentHelpVO attachmentHelpVO);

    /**
     * @Title: AttachmentService
     * @Description: Excel模板下载
     * @author TimBrian
     * @since Jun 23, 2021 2:11:22 PM
     * @param response
     * @param fileName
     * @return
     */
	Object linkTemplate(HttpServletResponse response, String fileName) throws UnsupportedEncodingException;

	/**
	 * @Title: AttachmentService
	 * @Description: 根据fileTokens获取图片列表
	 * @author TimBrian
	 * @since Jul 29, 2021 5:11:02 PM
	 * @param transform
	 * @return
	 */
	List<Attachment> selectFileListByTokens(Attachment transform);
}
